package com.dragon.modules.yuegou.query.act;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.act.GiftRecordEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 注册会员送礼记录表 动态查询条件
 *
 * @author pbuilder generated
 * @date 2021-05-11 17:09:45
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class GiftRecordQuery extends GiftRecordEntity implements Query<GiftRecordEntity>{

	/** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

	/** 订单id或者券包id查询条件 */
	@JsonUnwrapped(prefix = "giveId")
	private Condition<String> giveIdCondition;

	/** 用户id查询条件 */
	@JsonUnwrapped(prefix = "userId")
	private Condition<String> userIdCondition;

	/** 商圈Id查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

	/** 物品id查询条件 */
	@JsonUnwrapped(prefix = "articleId")
	private Condition<String> articleIdCondition;

	/** 礼物id查询条件 */
	@JsonUnwrapped(prefix = "giftId")
	private Condition<String> giftIdCondition;

	/** 礼物失效时间查询条件 */
	@JsonUnwrapped(prefix = "invalidTime")
	private Condition<LocalDateTime> invalidTimeCondition;

	/** 创建人ID查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

	/** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public GiftRecordQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 *
	 * @param entity 实体对象
	 */
	public GiftRecordQuery(GiftRecordEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 *
	 * @param other 查询条件对象
	 */
	public GiftRecordQuery(GiftRecordQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.giveIdCondition != null) {
			this.giveIdCondition = other.giveIdCondition.copy();
		}
		if(other.userIdCondition != null) {
			this.userIdCondition = other.userIdCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.articleIdCondition != null) {
			this.articleIdCondition = other.articleIdCondition.copy();
		}
		if(other.giftIdCondition != null) {
			this.giftIdCondition = other.giftIdCondition.copy();
		}
		if(other.invalidTimeCondition != null) {
			this.invalidTimeCondition = other.invalidTimeCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<GiftRecordEntity> toQueryWrapper() {
		QueryWrapper<GiftRecordEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (giveIdCondition != null) {
			giveIdCondition.toWrapper(wrapper, COL_GIVE_ID);
		}
		if (userIdCondition != null) {
			userIdCondition.toWrapper(wrapper, COL_USER_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (articleIdCondition != null) {
			articleIdCondition.toWrapper(wrapper, COL_ARTICLE_ID);
		}
		if (giftIdCondition != null) {
			giftIdCondition.toWrapper(wrapper, COL_GIFT_ID);
		}
		if (invalidTimeCondition != null) {
			invalidTimeCondition.toWrapper(wrapper, COL_INVALID_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 *
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}

	/**
	 * 获取查询条件
	 *
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 *
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回订单id或者券包id查询条件
	 *
	 * @return giveIdCondition 订单id或者券包id查询条件
	 */
	public Condition<String> giveId() {
		this.giveIdCondition = new Condition<>();
		return this.giveIdCondition;
	}

	/**
	 * 获取订单id或者券包id查询条件
	 *
	 * @return giveIdCondition 订单id或者券包id查询条件
	 */
	public Condition<String> getGiveIdCondition() {
		return giveIdCondition;
	}

	/**
	 * 设置订单id或者券包id查询条件
	 *
	 * @param giveIdCondition 订单id或者券包id查询条件
	 */
	public void setGiveIdCondition(Condition<String> giveIdCondition) {
		this.giveIdCondition = giveIdCondition;
	}

	/**
	 * 构造并返回用户id查询条件
	 *
	 * @return userIdCondition 用户id查询条件
	 */
	public Condition<String> userId() {
		this.userIdCondition = new Condition<>();
		return this.userIdCondition;
	}

	/**
	 * 获取用户id查询条件
	 *
	 * @return userIdCondition 用户id查询条件
	 */
	public Condition<String> getUserIdCondition() {
		return userIdCondition;
	}

	/**
	 * 设置用户id查询条件
	 *
	 * @param userIdCondition 用户id查询条件
	 */
	public void setUserIdCondition(Condition<String> userIdCondition) {
		this.userIdCondition = userIdCondition;
	}

	/**
	 * 构造并返回商圈Id查询条件
	 *
	 * @return busdIdCondition 商圈Id查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}

	/**
	 * 获取商圈Id查询条件
	 *
	 * @return busdIdCondition 商圈Id查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈Id查询条件
	 *
	 * @param busdIdCondition 商圈Id查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回物品id查询条件
	 *
	 * @return articleIdCondition 物品id查询条件
	 */
	public Condition<String> articleId() {
		this.articleIdCondition = new Condition<>();
		return this.articleIdCondition;
	}

	/**
	 * 获取物品id查询条件
	 *
	 * @return articleIdCondition 物品id查询条件
	 */
	public Condition<String> getArticleIdCondition() {
		return articleIdCondition;
	}

	/**
	 * 设置物品id查询条件
	 *
	 * @param articleIdCondition 物品id查询条件
	 */
	public void setArticleIdCondition(Condition<String> articleIdCondition) {
		this.articleIdCondition = articleIdCondition;
	}

	/**
	 * 构造并返回礼物id查询条件
	 *
	 * @return giftIdCondition 礼物id查询条件
	 */
	public Condition<String> giftId() {
		this.giftIdCondition = new Condition<>();
		return this.giftIdCondition;
	}

	/**
	 * 获取礼物id查询条件
	 *
	 * @return giftIdCondition 礼物id查询条件
	 */
	public Condition<String> getGiftIdCondition() {
		return giftIdCondition;
	}

	/**
	 * 设置礼物id查询条件
	 *
	 * @param giftIdCondition 礼物id查询条件
	 */
	public void setGiftIdCondition(Condition<String> giftIdCondition) {
		this.giftIdCondition = giftIdCondition;
	}

	/**
	 * 构造并返回礼物失效时间查询条件
	 *
	 * @return invalidTimeCondition 礼物失效时间查询条件
	 */
	public Condition<LocalDateTime> invalidTime() {
		this.invalidTimeCondition = new Condition<>();
		return this.invalidTimeCondition;
	}

	/**
	 * 获取礼物失效时间查询条件
	 *
	 * @return invalidTimeCondition 礼物失效时间查询条件
	 */
	public Condition<LocalDateTime> getInvalidTimeCondition() {
		return invalidTimeCondition;
	}

	/**
	 * 设置礼物失效时间查询条件
	 *
	 * @param invalidTimeCondition 礼物失效时间查询条件
	 */
	public void setInvalidTimeCondition(Condition<LocalDateTime> invalidTimeCondition) {
		this.invalidTimeCondition = invalidTimeCondition;
	}

	/**
	 * 构造并返回创建人ID查询条件
	 *
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}

	/**
	 * 获取创建人ID查询条件
	 *
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人ID查询条件
	 *
	 * @param createdByCondition 创建人ID查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 *
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}

	/**
	 * 获取创建时间查询条件
	 *
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 *
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

}
